﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="2001-1.aspx.cs" Inherits="_20_2001_1" %>

<%@ Register Assembly="MattBerseth.WebControls" Namespace="MattBerseth.WebControls" TagPrefix="cc1" %>
<%@ Register src="../lib/calendar.ascx" tagname="calendar" tagprefix="uc1" %>
<%@ Register src="../lib/FileJpg.ascx" tagname="FileJpg" tagprefix="uc2" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
	<title></title>
	<link type="text/css" href="../css/innerbox.css" rel="Stylesheet" />
	<link type="text/css" href="../css/main.css" rel="Stylesheet" />
</head>
<body>
	<form id="form1" runat="server">
	<asp:ObjectDataSource ID="ObjectDataSource1" runat="server" 
		OldValuesParameterFormatString="original_{0}" SelectMethod="Get_messagefile_AllData"
		TypeName="CCH.DAO.messagefileDAO">
		<SelectParameters>
			<asp:Parameter Name="mes_no" Type="Int32" />
		</SelectParameters>
	</asp:ObjectDataSource>
	<asp:ObjectDataSource ID="ObjectDataSource2" runat="server" 
		OldValuesParameterFormatString="original_{0}" 
		SelectMethod="Get_classification_AllData" TypeName="CCH.DAO.classificationDAO">
		<SelectParameters>
			<asp:QueryStringParameter Name="cla_sfuno" QueryStringField="type" 
				Type="Int32" />
		</SelectParameters>
	</asp:ObjectDataSource>
	<asp:HiddenField ID="hidd_no" runat="server" />
	<div id="Div1" class="bg">
		<div class="clr">
		</div>
		<div class="top_main3" style="margin-left: 29px;">
			<p>
				<asp:Label ID="lab_title" runat="server"></asp:Label></p>
		</div>
		<div class="clr">
		</div>
		<div class="datatable" style="height:280px" >
			<table width="100%" bgcolor="#FFFFFF" class="datatable-2">
				<tr>
					<td align="right" class="table-top2">
						類別
					</td>
					<td bgcolor="#FFFFFF" class="table-b">
						<asp:DropDownList ID="DropDownList1" runat="server" 
							DataSourceID="ObjectDataSource2" DataTextField="cla_name" 
							DataValueField="cla_no">
						</asp:DropDownList>
						<asp:Label ID="Label5" runat="server" ForeColor="Red" 
							Text="要新增類別，請至【系統管理 / 類別管理】新增"></asp:Label>
					</td>
				</tr>
				<tr>
					<td align="right" class="table-top2">
						標題
					</td>
					<td bgcolor="#FFFFFF" class="table-b">
						<asp:TextBox ID="tbox_title" runat="server" MaxLength="250" Height="50px" 
							TextMode="MultiLine" Width="320px"></asp:TextBox>
					</td>
					
				</tr>
				<tr>
					<td align="right" class="table-top2">
						內容
					</td>
					<td bgcolor="#FFFFFF" class="table-b">
						<asp:TextBox ID="tbox_content" runat="server" MaxLength="500" Height="150px" 
							TextMode="MultiLine" Width="500px"></asp:TextBox>
					</td>
					
				</tr>
				<tr>
					<td align="right" class="table-top2">
						發表日期
					</td>
					<td bgcolor="#FFFFFF" class="table-b">
						
						<uc1:calendar ID="calendar1" runat="server" />
						
					</td>
					
				</tr>
				<asp:Panel ID="Panel1" runat="server">
				<tr>
					<td align="right" class="table-top2">
						相關檔案
					</td>
					<td bgcolor="#FFFFFF" class="table-b">
						<cc1:GridView ID="GridView1" runat="server" DataSourceID="ObjectDataSource1" 
							AutoGenerateColumns="False" EmptyDataText="目前無資料" 
							OnRowCommand="GridView1_RowCommand" Width="100%" DataKeyNames="file_no">
							<Columns>
								<asp:TemplateField HeaderText="檔案名稱">
									<ItemTemplate>
										<asp:Label ID="Label4" runat="server" Text='<%# Eval("file_name") %>'></asp:Label>
									</ItemTemplate>
								</asp:TemplateField>
								
								<asp:TemplateField HeaderText="下載" ItemStyle-HorizontalAlign="Center">
									<ItemTemplate>
										<a class="imageButton edit" title="下載" href='<%# Eval("file_no", "2001-2.ashx?file_no={0}") %>' target="_blank">
											<span>下載</span></a>
									</ItemTemplate>
									<ItemStyle HorizontalAlign="Center" Width="10%" />
								</asp:TemplateField>

								<asp:TemplateField HeaderText="刪除">
									<ItemTemplate>
										<asp:Button ID="button_disable" runat="server" CommandName="disable" CssClass="delete"
											CommandArgument="<%# Container.DataItemIndex %>" OnClientClick=" return confirm('確定要刪除?')" />
									</ItemTemplate>
									<ItemStyle HorizontalAlign="Center" Width="10%" />
								</asp:TemplateField>
							</Columns>
						</cc1:GridView>
					</td>
				</tr>
				<tr>
					<td align="right" class="table-top2">
						上傳檔案
					</td>
					<td bgcolor="#FFFFFF" class="table-b">
						<asp:FileUpload ID="FileUpload1" runat="server" />
						&nbsp;&nbsp;
						<asp:Button ID="Button1" runat="server" Text="上傳" CssClass="a-input" onclick="Button1_Click" />
					</td>
				</tr>
				</asp:Panel>
				<asp:Panel ID="Panel2" runat="server">
				<tr>
					<td align="right" class="table-top2">
						上傳檔案
					</td>
					<td bgcolor="#FFFFFF" class="table-b">
						<asp:FileUpload ID="FileUpload2" runat="server" />
						<br />
						<asp:FileUpload ID="FileUpload3" runat="server" />
						<br />
						<asp:FileUpload ID="FileUpload4" runat="server" />
						<br />
						<asp:FileUpload ID="FileUpload5" runat="server" />
						<br />
						<asp:FileUpload ID="FileUpload6" runat="server" />
						<br />
					</td>
				</tr>
				</asp:Panel>
			</table>
			<div style="height:15px"></div>
			<div class="pager" align="center">
				<asp:Button ID="btn_ok" runat="server" CssClass="input-OK" Text="確定" 
					onclick="btn_ok_Click" />&nbsp;
				<asp:Button ID="btn_cancel" runat="server" CssClass="input-no" Text="取消" OnClientClick="self.parent.tb_remove()"
					UseSubmitBehavior="False" />
			</div>
			
			<div style="height:15px"></div>
		</div>
		
	</div>
	</form>
</body>
</html>
